/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PanActionInit.java
 *
 * Created on 14 janv. 2012, 15:44:51
 */
package InterfaceGraphique.commonPannel;

import InterfaceGraphique.FenJeuEntrer;
import java.awt.Font;
import java.io.FileInputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;

/**
 *
 * @author Arthur
 */
public class PanActionInit extends javax.swing.JPanel {

    private FenJeuEntrer parent; 
    
    /** Creates new form PanActionInit */
    public PanActionInit() {
        this.parent = null;
        
        initComponents();
    }
    public PanActionInit(FenJeuEntrer parent) {
        this.parent = parent;
        initComponents(); 
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bDonjon = new javax.swing.JButton();
        bFinTour = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();

        setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        setMinimumSize(new java.awt.Dimension(820, 600));
        setPreferredSize(new java.awt.Dimension(820, 600));
        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        bDonjon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/entrerdonjon.png"))); // NOI18N
        bDonjon.setName("bDonjon"); // NOI18N
        bDonjon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bDonjonActionPerformed(evt);
            }
        });
        add(bDonjon, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 540, 140, 30));

        bFinTour.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/fintour.png"))); // NOI18N
        bFinTour.setEnabled(false);
        bFinTour.setName("bFinTour"); // NOI18N
        bFinTour.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bFinTourActionPerformed(evt);
            }
        });
        add(bFinTour, new org.netbeans.lib.awtextra.AbsoluteConstraints(620, 550, 140, 30));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/InterfaceGraphique/resources/porte-donjon.jpg"))); // NOI18N
        jLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabel1.setName("jLabel1"); // NOI18N
        add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 80, -1, -1));

        jLabel2.setForeground(new java.awt.Color(213, 151, 0));
        jLabel2.setText("Vous apercevez l'entrée d'un sombre donjon...");
        jLabel2.setName("jLabel2"); // NOI18N
        add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 30, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.jLabel2.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }
    }// </editor-fold>//GEN-END:initComponents

    private void bDonjonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bDonjonActionPerformed
        // TODO add your handling code here:
        this.parent.entrerDonjon();
    }//GEN-LAST:event_bDonjonActionPerformed

    private void bFinTourActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bFinTourActionPerformed
        // TODO add your handling code here:
        this.parent.finTour();
        
    }//GEN-LAST:event_bFinTourActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bDonjon;
    private javax.swing.JButton bFinTour;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    // End of variables declaration//GEN-END:variables

    public JButton getbDonjon() {
        return bDonjon;
    }

    public JButton getbFinTour() {
        return bFinTour;
    }

    
}
